using SalesPages.DomainModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class SchoolDirectionMap : EntityTypeConfiguration<SchoolDirection>
    {
        public SchoolDirectionMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.schoolcode)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.option1name)
                .HasMaxLength(100);

            this.Property(t => t.option2name)
                .HasMaxLength(100);

            this.Property(t => t.option3name)
                .HasMaxLength(100);

            this.Property(t => t.workdayopenhour)
                .HasMaxLength(10);

            this.Property(t => t.workdayopenmin)
                .HasMaxLength(10);

            this.Property(t => t.workdayclosehour)
                .HasMaxLength(10);

            this.Property(t => t.workdayclosemin)
                .HasMaxLength(10);

            this.Property(t => t.saturdayopenhour)
                .HasMaxLength(10);

            this.Property(t => t.saturdayopenmin)
                .HasMaxLength(10);

            this.Property(t => t.saturdayclosehour)
                .HasMaxLength(10);

            this.Property(t => t.saturdayclosemin)
                .HasMaxLength(10);

            this.Property(t => t.sundayopenhour)
                .HasMaxLength(10);

            this.Property(t => t.sundayopenmin)
                .HasMaxLength(10);

            this.Property(t => t.sundayclosehour)
                .HasMaxLength(10);

            this.Property(t => t.sundayclosemin)
                .HasMaxLength(10);

            this.Property(t => t.Landmark)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.SchoolName)
                .HasMaxLength(200);

            this.Property(t => t.MetaKeywords)
                .HasMaxLength(200);

            this.Property(t => t.MetaDescription)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("SchoolDirection");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.schoolcode).HasColumnName("schoolcode");
            this.Property(t => t.option1name).HasColumnName("option1name");
            this.Property(t => t.option1direction).HasColumnName("option1direction");
            this.Property(t => t.option2name).HasColumnName("option2name");
            this.Property(t => t.option2direction).HasColumnName("option2direction");
            this.Property(t => t.option3name).HasColumnName("option3name");
            this.Property(t => t.option3direction).HasColumnName("option3direction");
            this.Property(t => t.workdayopenhour).HasColumnName("workdayopenhour");
            this.Property(t => t.workdayopenmin).HasColumnName("workdayopenmin");
            this.Property(t => t.workdayclosehour).HasColumnName("workdayclosehour");
            this.Property(t => t.workdayclosemin).HasColumnName("workdayclosemin");
            this.Property(t => t.saturdaydisable).HasColumnName("saturdaydisable");
            this.Property(t => t.saturdayopenhour).HasColumnName("saturdayopenhour");
            this.Property(t => t.saturdayopenmin).HasColumnName("saturdayopenmin");
            this.Property(t => t.saturdayclosehour).HasColumnName("saturdayclosehour");
            this.Property(t => t.saturdayclosemin).HasColumnName("saturdayclosemin");
            this.Property(t => t.sundaydisable).HasColumnName("sundaydisable");
            this.Property(t => t.sundayopenhour).HasColumnName("sundayopenhour");
            this.Property(t => t.sundayopenmin).HasColumnName("sundayopenmin");
            this.Property(t => t.sundayclosehour).HasColumnName("sundayclosehour");
            this.Property(t => t.sundayclosemin).HasColumnName("sundayclosemin");
            this.Property(t => t.insertdate).HasColumnName("insertdate");
            this.Property(t => t.updatedate).HasColumnName("updatedate");
            this.Property(t => t.Landmark).HasColumnName("Landmark");
            this.Property(t => t.SchoolName).HasColumnName("SchoolName");
            this.Property(t => t.MetaKeywords).HasColumnName("MetaKeywords");
            this.Property(t => t.MetaDescription).HasColumnName("MetaDescription");
            this.Property(t => t.OpeningStatus).HasColumnName("OpeningStatus");
        }
    }
}
